<template>
  <div>
    <div class="control-title">
      控制台<span @click="back" class="back">返回</span>
    </div>
    <home-icons :list="iconList"></home-icons>
  </div>
</template>
<script>
/* eslint-disable */
import HomeIcons from "../control/components/Icons.vue";
import axios from "axios";
export default {
  name: "Control",
  components: {
    HomeIcons,
  },
  data() {
    return {
      iconList: [],
    };
  },
  methods: {
    getIconInfo() {
      console.log("从数据库中获取数据");
      axios.defaults.baseURL = process.env.BASE_API;
      console.log(process.env.BASE_API);
      axios.get("/api/icon/list").then(this.getIconInfoSucc);
    },
    getIconInfoSucc(res) {
      console.log(res);
      this.iconList = res.data;
    },
    back: function () {
      this.$router.push("/");
    },
  },
  mounted() {
    this.getIconInfo();
  },
};
</script>
<style scoped>
.control-title {
  margin-top: 0.2rem;
  margin-bottom: 0.6rem;
  line-height: 0.8rem;
  background: #eee;
  text-indent: 0.2rem;
}

.back {
  color: #ff9300;
  float: right;
  margin-right: 0.16rem;
}
</style>
